package org.lanqiao.ssm.facede.auth.facede.impl;

import javax.annotation.Resource;

import org.lanqiao.ssm.common.core.facede.base.BaseQueryFacede;
import org.lanqiao.ssm.common.core.service.BaseServiceI;
import org.lanqiao.ssm.common.exceptions.LoginException;
import org.lanqiao.ssm.facede.auth.facede.UserQueryFacedeI;
import org.lanqiao.ssm.facede.auth.model.User;
import org.lanqiao.ssm.facede.auth.service.UserServiceI;
import org.springframework.stereotype.Component;

import com.github.pagehelper.PageInfo;

@Component("userQueryFacede")
public class UserQueryFacedeImpl extends BaseQueryFacede<User, String>
		implements UserQueryFacedeI {

	@Resource
	private UserServiceI userService;

	public BaseServiceI<User, String> getService() {
		return userService;
	}

	@Override
	public User login(User u) {
		return userService.login(u);
	}

	@Override
	public PageInfo<User> findUserAndRoles(User user,int page,int pageShow)
			throws LoginException {
		return userService.findUserAndRoles(user, page, pageShow);
	}

	@Override
	public User findUserByLoginName(String loginName) throws LoginException {
		
		return userService.findUserByLoginName(loginName);
	}

}
